package com.insight.config;

import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * T126: Prometheus Metrics 配置
 * 配置自定义指标和监控项
 *
 * @author Insight Team
 */
@Configuration
public class MetricsConfig {

    /**
     * 启用 @Timed 注解支持
     * 可在 Service 方法上使用 @Timed 注解收集方法执行时间指标
     */
    @Bean
    public TimedAspect timedAspect(MeterRegistry registry) {
        return new TimedAspect(registry);
    }
}
